Merged
Conversation
When a new database is created, the title input auto-focuses with the
child grid view's name ("Grid") because the container's name resolves a
tick later. The remote-update effect skipped re-syncing while focused, so
a subsequent blur (without any typing) silently persisted "Grid" via the
API — corrupting the container name. After refresh, the corrupted name
was loaded.
- TitleEditable: allow remote prop updates to flow into the contentEditable
while focused as long as the user hasn't typed; skip the blur write when
no user edit occurred.
- DatabaseView: fall back to the breadcrumb chain to resolve the database
container when the shallow outline doesn't yet include it, so the title
reflects the container's name immediately after refresh.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Reviewer's GuideFixes incorrect database renaming by making TitleEditable safely accept remote name updates while focused (when the user hasn’t typed) and avoiding blur-based writes when no edits occurred, and by having DatabaseView fall back to breadcrumb ancestry to resolve the database container when it’s missing from the shallow outline, with added test coverage for the new breadcrumb behavior. Sequence diagram for TitleEditable handling remote name updates while focusedsequenceDiagram
actor User
participant TitleEditable
participant API
User->>TitleEditable: NavigateToNewDatabase
TitleEditable->>TitleEditable: MountAndAutoFocus
TitleEditable->>API: RequestDatabaseMeta
API-->>TitleEditable: RemoteNameUpdate NewDatabase
TitleEditable->>TitleEditable: useEffectRemoteUpdate
TitleEditable->>TitleEditable: CheckTypingWindow
TitleEditable->>TitleEditable: CheckRecentUpdateWindow
TitleEditable->>TitleEditable: DetectNoUserTyping
TitleEditable->>TitleEditable: UpdateContentEditableWithRemoteName
User->>TitleEditable: ClickOutsideWithoutTyping
TitleEditable->>TitleEditable: handleBlur
TitleEditable->>TitleEditable: DetectNoUserTyping
TitleEditable--xAPI: SkipSendUpdateImmediately
Class diagram for TitleEditable name syncing and DatabaseView container resolutionclassDiagram
class TitleEditable {
+boolean isFocused
+Ref contentRef
+Ref lastInputTimeRef
+Ref lastUpdateSentTimeRef
+Ref sentValuesRef
+Ref blurTimerRef
+Ref cleanupTimerRef
+handleBlur()
+useEffectRemoteUpdate()
}
class DatabaseView {
+string databasePageId
+Breadcrumb[] breadcrumbs
+View view
+View containerView
+View breadcrumbContainerView
+View pageView
+computeView()
+computeContainerView()
+computeBreadcrumbContainerView()
}
class Breadcrumb {
+string view_id
}
class View {
+string id
+string name
}
TitleEditable --> View : updatesTitleFor
DatabaseView --> Breadcrumb : uses
DatabaseView --> View : resolvesContainer
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
"Grid"after creation. After a page refresh the corrupted name was shown, while the desktop app correctly keeps the user-provided container name.TitleEditableauto-focuses on mount with the child grid view's name ("Grid") because the container's name resolves a tick later. The remote-update effect bailed out while focused, and the subsequent blur unconditionally persisted the stale text via the API.TitleEditable, allow remote prop updates to sync into thecontentEditablewhile focused as long as the user hasn't typed, and skip the blur write when no user edit occurred. InDatabaseView, add a breadcrumb-based fallback for resolving the container so the title reflects the container's name even when the shallow outline (depth=2) doesn't yet include it.Test plan
DatabaseView.databaseContainertests pass+menu → title shows "New Database"🤖 Generated with Claude Code
Summary by Sourcery
Preserve database container titles when creating or loading databases by improving title synchronization and container resolution.
Bug Fixes:
Tests: